<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>需求评审</title>
    <link rel="stylesheet" href="/lims/layui/css/layui.css?20190817.1">
    <link rel="stylesheet" href="/lims/css/common.css">
    <script src="/lims/layui/layui.js"></script>
    <script type="text/javascript" src="/lims/layui/global.js"></script>
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lims/js/baseCode/base.js?v=201908121454" type="text/javascript" charset="utf-8"></script>
    <script src="/lims/js/common.js?v=201907231346" type="text/javascript" charset="utf-8"></script>
    <style>
        .layui-table-view .layui-table td, .layui-table-view .layui-table th {
            padding: 3px 0;
        }
        .layui-tab-item {
            height: 100%;
        }
        .layui-tab-item iframe{
            width: 100%;
            height:100%;
        }
        .layui-card{
            background: #fff;
            padding: 0px 5px;
        }
    </style>
</head>
<body>
<div class="layui-card" style="margin:0;width: 100%;height: 100%;padding: 0;position: fixed;">
    <div class="layui-tab layui-tab-brief" lay-filter="edittabbar" style="height: 100%;">
        <ul class="layui-tab-title">
            <li><span style="font-size: 16px">基本信息</span></li>
            <li><span style="font-size: 16px">产品/实验信息</span></li>
            <li class="layui-this"><span style="font-size: 15px">需求分析</span></li>
            <li><span style="font-size: 15px">外包/外协/外购</span></li>
            <li><span style="font-size: 16px">附件</span></li>
        </ul>
        <div class="layui-tab-content" style="position:relative;overflow:hidden;padding: 0;height: 100%;">
            <div class="layui-tab-item">
                <iframe id="basicInfoUrl" frameborder="no" src=""></iframe>
            </div>
            <div class="layui-tab-item">
                <iframe id="productInfoUrl" frameborder="no" src=""></iframe>
            </div>
            <div class="layui-tab-item layui-show">
                <iframe id="analysisUrl" frameborder="no" src=""></iframe>
            </div>
            <div class="layui-tab-item">
                <iframe id="outsourceUrl" frameborder="no" src=""></iframe>
            </div>
            <div class="layui-tab-item">
                <iframe id="proappendixUrl" frameborder="no" src=""></iframe>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var customerName;//客户名称
    var customerId;//客户ID
    var runId=window.parent.runId;//获取 父页面 地址栏 参数 runId
    var projectId='';
    var deptId='';

    $("#basicInfoUrl").attr("src", '/project_input/basicInfo?deptId='+deptId+'&begin=look&projectId='+projectId+'');
    $("#productInfoUrl").attr("src", '/project_input/productInfo?projectId='+projectId+'&begin=look');
    $("#analysisUrl").attr("src", '/project_task/analysis?begin=edit&projectId='+projectId+'&deptId='+deptId+'&customerName='+customerName+'&customerId='+customerId+ '&begin=editTask');
    $("#outsourceUrl").attr("src", '/project_task/outsource?begin=edit&projectId='+projectId+'');
    $("#proappendixUrl").attr("src", '/project_input/proappendix?projectId='+projectId+'&begin=look');
    layui.use(['table', 'laydate', 'layer', 'form', 'element', 'upload', 'tree', 'soulTable'], function () {

    });

    // 获取url参数 projectId和deptId
    $.ajax({
        url: '/workapp/work/selectProjectByRunId?runId='+runId,
        type: 'post',
        dataType: 'json',
        success: function (res) {
            if(res.code== 0){
                projectId=res.object.projectId; //立项已经生成，后台返回立项Id
                deptId=res.object.projectId;
                $("#analysisUrl").attr("src", '/project_task/analysis?begin=edit&projectId='+projectId+'&deptId='+deptId+'&customerName='+customerName+'&customerId='+customerId+'&begin=editTask');
            }
        }
    });

    setTimeout(function () {
        customerName=$("#basicInfoUrl").contents().find("#customerName").val();//客戶名称
        customerId=$("#basicInfoUrl").contents().find("#customerId").attr('name');//客户id

        $("#productInfoUrl").contents().find("#customerName").val(customerName);//产品/试验信息 页面 客戶名称
    },1000)
</script>
</body>
</html>